package com.vae.search.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;
import java.util.Map;

/**
 * es里的Spu
 */
@Data
@Document(indexName = "shopsearch_spues",type = "_doc")
public class SpuEs {
    @Id
    private String id;
    @Field(type= FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String name;
    @Field(type= FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_smart")
    private String intro;//简介
    private Integer brandId;
    private Integer categoryOneId;//一级分类id
    private Integer categoryTwoId; //二级分类id
    private Integer categoryThreeId;//三级分类id
    private String images;//图片
    private String afterSalesService;//售后服务
    private String content;//介绍
    private String attributeList;
    ///是否上架,0已下架，1已上架
    private Integer isMarketable;
    //是否删除,0:未删除，1：已删除
    private Integer isDelete;
    //审核状态，0：未审核，1：已审核，2：审核不通过
    private Integer status;
    //当前spu下的sku的最低价格
    @Field(type= FieldType.Keyword)
    private Integer minPrice;

    //属性映射(动态创建域信息)
    // key = 学习费用
    // value = 【1万，2万】
    private Map<String, List<String>> attrMap;
}
